// 商品管理/商品列表
import request from "@/utils/requset";

// 获取商品列表数据
export const getShopListAPI = () => request.get(`Goods/goodsList`);

// 设置单品商品
export const setDanGoodsAPI = (id, is_danpin) =>
  request.post(`Goods/danGoods?id=${id}/`, { is_danpin: is_danpin });

// 设置上新商品
export const setShangXinGoodsAPI = (id, is_shangxin) =>
  request.post(`Goods/shangxinGoods?id=${id}/`, { is_shangxin: is_shangxin });

// 设置精选商品
export const setJingXuanGoodsAPI = (id, is_jingxuan) =>
  request.post(`Goods/jingxuanGoods?id=${id}/`, { is_jingxuan: is_jingxuan });

// 添加商品
export const addShopListAPI = (value)=>{
    console.log(value,'sdfsfsfsfsfsf');    
    
   return request.post(`Goods/addGoods/`,value)
}

// 获取回显数据
export const getBackAPI = (id)=>request.post(`Goods/editGoods?id=${id}`)

// 修改商品
export const updateShopAPI = (id,value)=>request.post(`Goods/editGoodsTo?id=${id}/`,value)

// 删除商品
export const delShopAPI = (id)=>request.post(`Goods/deleteGoods?id=${id}`)